/* 串联加载脚本 */
export const seriesLoadScripts = (scripts, callback) => {
    if (typeof scripts != 'object') scripts = [scripts];
    var HEAD = document.getElementsByTagName('head').item(0) || document.documentElement;
    var s = new Array(),
        last = scripts.length - 1,
        recursiveLoad = function (i) {
            s[i] = document.createElement('script');
            s[i].setAttribute('type', 'text/javascript');
            s[i].onload = s[i].onreadystatechange = function () {
                if (!0 || this.readyState == 'loaded' || this.readyState == 'complete') {
                    this.onload = this.onreadystatechange = null;
                    this.parentNode.removeChild(this);
                    if (i != last) recursiveLoad(i + 1);
                    else if (typeof callback == 'function') callback();
                }
            };
            s[i].setAttribute('src', scripts[i]);
            HEAD.appendChild(s[i]);
        };
    recursiveLoad(0);
};
// 图片压缩

// 检测特定移动设备特征
export const isMobile = () => {
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
